<?php

class Tag_Combo{
	static $XSL;
}

Tag_Combo::$XSL = <<<EOD
<xsl:template match="i:combo">
<div id="{@id}_frame">
<input type="hidden" name="{@name}" id="{@id}_selected"/>
<div class="write-input">
	<input type="text" class="input" id="{@id}" autocomplete="off" tagindex="1"/>
<xsl:if test="@with-btn='true'">
	<input type="button" class="btn" id="{@id}_dropbtn"/>
</xsl:if>
</div>
<div class="write-input-popup" id="{@id}_drop" style="display:none">
	<ul>	
	</ul>
</div>
</div>
<script>
var <xsl:value-of select="@id"/> = new Combo(
	"<xsl:value-of select="@id"/>",
	[
<xsl:for-each select="i:combo-option">
["<xsl:value-of select="@value"/>", "<xsl:value-of select="."/>", "<xsl:value-of select="@match"/>"]<xsl:if test="position()&lt;count(//i:combo-option)">,</xsl:if>
</xsl:for-each>
	]
	<xsl:if test="@absolute">
	,<xsl:value-of select="@absolute"/>
	</xsl:if>
);
</script>
</xsl:template>
EOD;
